package com.jaws.core.endpoint;

import java.util.Map;

import lombok.extern.slf4j.Slf4j;

import org.springframework.boot.actuate.endpoint.HealthEndpoint;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.Health.Builder;
import org.springframework.boot.actuate.health.HealthAggregator;
import org.springframework.boot.actuate.health.HealthIndicator;

import com.jaws.core.common.log.Log;

/**
 * 断点检查
 * @author maojian
 * @date 2018-07-16 11:45:26
 * @since v1.0.0
 */
@Slf4j
public class JawsEndpoint extends HealthEndpoint{

	public JawsEndpoint(HealthAggregator healthAggregator, Map<String, HealthIndicator> healthIndicators) {
		super(healthAggregator, healthIndicators);
	}
	
	@Override
	public Health invoke() {
		try{
			super.invoke();
		}catch(Exception e){
			log.error(Log.op("JawsEndpoint.invoke").msg("health check error").toString(), e);
		}
		return new Builder().up().build();
	}

}
